package fr.univ.colloque.data;

public class Notation implements Comparable<Object>
{
    private static int COEF_IMPORTANCE = 1;
    private static int COEF_PERTINENCE = 1;
    private static int COEF_LISIBILITE = 1;
    private static int COEF_DECISION = 3;
    
    private Integer pertinence;
    private Integer importance;
    private Integer lisibilite;
    private Integer decision;

    public Notation(int pertinence, int importance, int lisibilite, int decision)
    {
        this.pertinence = pertinence;
        this.importance = importance;
        this.lisibilite = lisibilite;
        this.decision = decision;
    }
     
    public int getPertinence()
    {
        return pertinence;
    }

    public void setPertinence(int pertinence)
    {
        this.pertinence = pertinence;
    }

    public int getImportance()
    {
        return importance;
    }

    public void setImportance(int importance)
    {
        this.importance = importance;
    }

    public int getLisibilite()
    {
        return lisibilite;
    }

    public void setLisibilite(int lisibilite)
    {
        this.lisibilite = lisibilite;
    }

    public int getDecision()
    {
        return decision;
    }

    public void setDecision(int decision)
    {
        this.decision = decision;
    }
       
    public int getNoteFinale()
    {
        int result = getImportance() * COEF_IMPORTANCE + getPertinence() * COEF_PERTINENCE + getLisibilite() * COEF_LISIBILITE + getDecision() * COEF_DECISION;

        return result;
    }

    @Override
    public int compareTo(Object o)
    {
        Notation noteComparable = (Notation) o;

        if (this.getNoteFinale() > noteComparable.getNoteFinale())
        {
            return -1;
        }
        else if (this.getNoteFinale() < noteComparable.getNoteFinale())
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
}
